home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 60 / IOPROG_60.ISO / soft / c++ / gsl-1.1.1-setup.exe / {app} / src / specfunc / test_sf.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-04-18  |  3.5 KB  |  77 lines

  1. /* specfunc/test_sf.h
  2.  * 
  3.  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
  4.  * 
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or (at
  8.  * your option) any later version.
  9.  * 
  10.  * This program is distributed in the hope that it will be useful, but
  11.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * General Public License for more details.
  14.  * 
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. /* Author:  G. Jungman */
  21.  
  22. #ifndef TEST_SF_H
  23. #define TEST_SF_H
  24.  
  25. #include <gsl/gsl_math.h>
  26. #include <gsl/gsl_errno.h>
  27. #include <gsl/gsl_machine.h>
  28. #include <gsl/gsl_sf_result.h>
  29.  
  30. double test_sf_frac_diff(double x1, double x2);
  31. int test_sf_check_result(char * message_buff, gsl_sf_result r, double val, double tol);
  32. int test_sf_check_val(char * message_buff, double rval, double val, double tol);
  33. int test_sf_check_return(char * message_buff, int val_return, int expected_return);
  34. int test_sf_check_result_relax(char * message_buff, gsl_sf_result r, double val, double tol);
  35.  
  36. #define TEST_TOL0  (2.0*GSL_DBL_EPSILON)
  37. #define TEST_TOL1  (16.0*GSL_DBL_EPSILON)
  38. #define TEST_TOL2  (256.0*GSL_DBL_EPSILON)
  39. #define TEST_TOL3  (2048.0*GSL_DBL_EPSILON)
  40. #define TEST_TOL4  (16384.0*GSL_DBL_EPSILON)
  41. #define TEST_TOL5  (131072.0*GSL_DBL_EPSILON)
  42. #define TEST_TOL6  (1048576.0*GSL_DBL_EPSILON)
  43. #define TEST_SQRT_TOL0 (2.0*GSL_SQRT_DBL_EPSILON)
  44. #define TEST_SNGL  (1.0e-06)
  45.  
  46. #define TEST_SF_INCONS  1
  47. #define TEST_SF_ERRNEG  2
  48. #define TEST_SF_TOLBAD  4
  49. #define TEST_SF_RETBAD  8
  50.  
  51. int test_sf (gsl_sf_result r, double val_in, double tol, int status, int expect_return, const char * desc);
  52. int test_sf_val (double val, double val_in, double tol, const char * desc);
  53. int test_sf_rlx (gsl_sf_result r, double val_in, double tol, int status, int expect_return, const char * desc);
  54. int test_sf_2 (gsl_sf_result r1, double val1, double tol1, gsl_sf_result r2, double val2, double tol2, int status, int expect_return, const char * desc);
  55. int test_sf_sgn (gsl_sf_result r, double sgn, double val_in, double tol, double expect_sgn, int status, int expect_return, const char * desc);
  56.  
  57. #define TEST_SF(stat, func, args, val_in, tol, expect_return) { int status = func args; stat += test_sf(r, val_in, tol, status, expect_return, #func #args); }
  58.  
  59. #define TEST_SF_VAL(stat, func, args, val_in, tol) { double val = func args; stat += test_sf_val(val, val_in, tol, #func #args); }
  60.  
  61. #define TEST_SF_RLX(stat, func, args, val_in, tol, expect_return) { int status = func args; stat += test_sf_rlx(r, val_in, tol, status, expect_return, #func #args); }
  62.  
  63. #define TEST_SF_2(stat, func, args, val1, tol1, val2, tol2, expect_return) { int status = func args; stat += test_sf_2(r1, val1, tol1, r2, val2, tol2, status, expect_return, #func #args); }
  64.  
  65. #define TEST_SF_SGN(stat, func, args, val_in, tol, expect_sgn, expect_return) { int status = func args; stat += test_sf_sgn(r, sgn, val_in, tol, expect_sgn, status, expect_return, #func #args); }
  66.  
  67. int test_airy(void);
  68. int test_bessel(void);
  69. int test_coulomb(void);
  70. int test_dilog(void);
  71. int test_gamma(void);
  72. int test_hyperg(void);
  73. int test_legendre(void);
  74.  
  75.  
  76. #endif /* !TEST_SF_H */
  77.